package com.yx.frame.jdbc;

import org.json.JSONArray;

import com.yx.frame.util.ZipUtils;

public final class Column extends JSONArray {
	String name;

	protected Column(String name) {
		this.name = name;
	}

	public final String getName() {
		return name;
	}

	public final String getAt(int row) throws Exception {
		try{
			return getString(row);
		}catch(Exception e){
			return null;
		}
	}

	public final int getRowCount() {
		return length();
	}

	public final void unzip() throws Exception {
		int len = this.length();
		for (int i = 0; i < len; i++) {
			String zipValue = getAt(i);
			//System.out.println(zipValue);
			zipValue = ZipUtils.gunzip(zipValue);
			put(i, zipValue);
		}
	}
}
